#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenericResult {
    #[prost(bool, tag="2")]
    pub succeed: bool,
    #[prost(string, tag="3")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrieveMessageRequest {
    #[prost(string, tag="1")]
    pub app_uuid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RetrieveMessageResponse {
    #[prost(message, repeated, tag="1")]
    pub messages: ::prost::alloc::vec::Vec<super::entity::Message>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PipeConnectionRequest {
    #[prost(message, optional, tag="1")]
    pub application_information: ::core::option::Option<super::entity::TransformerApplication>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PipeConnectionResponse {
    #[prost(bool, tag="1")]
    pub succeed: bool,
    #[prost(message, optional, tag="2")]
    pub result: ::core::option::Option<GenericResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePipeRequest {
    #[prost(message, optional, tag="1")]
    pub pipe: ::core::option::Option<super::entity::MessagePipe>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreatePipeResponse {
    #[prost(message, optional, tag="1")]
    pub pipe: ::core::option::Option<super::entity::MessagePipe>,
    #[prost(message, optional, tag="2")]
    pub result: ::core::option::Option<GenericResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePipeRequest {
    #[prost(message, optional, tag="1")]
    pub pipe: ::core::option::Option<super::entity::MessagePipe>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePipeResponse {
    #[prost(message, optional, tag="1")]
    pub pipe: ::core::option::Option<super::entity::MessagePipe>,
    #[prost(message, optional, tag="2")]
    pub result: ::core::option::Option<GenericResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishPipeMessageRequest {
    #[prost(message, repeated, tag="1")]
    pub message: ::prost::alloc::vec::Vec<super::entity::Message>,
    #[prost(string, tag="2")]
    pub app_uuid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublishPipeMessageResponse {
    #[prost(message, optional, tag="1")]
    pub result: ::core::option::Option<GenericResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPipesAndAppsResponse {
    #[prost(message, repeated, tag="1")]
    pub pipes: ::prost::alloc::vec::Vec<super::entity::MessagePipe>,
    #[prost(message, repeated, tag="2")]
    pub apps: ::prost::alloc::vec::Vec<super::entity::TransformerApplication>,
    #[prost(message, optional, tag="3")]
    pub result: ::core::option::Option<GenericResult>,
}
/// Generated client implementations.
pub mod legan_piping_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    #[derive(Debug, Clone)]
    pub struct LeganPipingClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LeganPipingClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> LeganPipingClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> LeganPipingClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            LeganPipingClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with `gzip`.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_gzip(mut self) -> Self {
            self.inner = self.inner.send_gzip();
            self
        }
        /// Enable decompressing responses with `gzip`.
        #[must_use]
        pub fn accept_gzip(mut self) -> Self {
            self.inner = self.inner.accept_gzip();
            self
        }
        pub async fn create_pipe(
            &mut self,
            request: impl tonic::IntoRequest<super::CreatePipeRequest>,
        ) -> Result<tonic::Response<super::CreatePipeResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/createPipe",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn update_pipe(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdatePipeRequest>,
        ) -> Result<tonic::Response<super::UpdatePipeResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/updatePipe",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn connect_to_pipe(
            &mut self,
            request: impl tonic::IntoRequest<super::PipeConnectionRequest>,
        ) -> Result<tonic::Response<super::PipeConnectionResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/connectToPipe",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn retrieve_pipe_message(
            &mut self,
            request: impl tonic::IntoStreamingRequest<
                Message = super::RetrieveMessageRequest,
            >,
        ) -> Result<
            tonic::Response<tonic::codec::Streaming<super::RetrieveMessageResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/retrievePipeMessage",
            );
            self.inner.streaming(request.into_streaming_request(), path, codec).await
        }
        pub async fn publish_pipe_message(
            &mut self,
            request: impl tonic::IntoRequest<super::PublishPipeMessageRequest>,
        ) -> Result<tonic::Response<super::PublishPipeMessageResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/publishPipeMessage",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
        pub async fn list_pipes_and_apps(
            &mut self,
            request: impl tonic::IntoRequest<super::super::entity::Empty>,
        ) -> Result<tonic::Response<super::ListPipesAndAppsResponse>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/Legan.LeganPiping/listPipesAndApps",
            );
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod legan_piping_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    ///Generated trait containing gRPC methods that should be implemented for use with LeganPipingServer.
    #[async_trait]
    pub trait LeganPiping: Send + Sync + 'static {
        async fn create_pipe(
            &self,
            request: tonic::Request<super::CreatePipeRequest>,
        ) -> Result<tonic::Response<super::CreatePipeResponse>, tonic::Status>;
        async fn update_pipe(
            &self,
            request: tonic::Request<super::UpdatePipeRequest>,
        ) -> Result<tonic::Response<super::UpdatePipeResponse>, tonic::Status>;
        async fn connect_to_pipe(
            &self,
            request: tonic::Request<super::PipeConnectionRequest>,
        ) -> Result<tonic::Response<super::PipeConnectionResponse>, tonic::Status>;
        ///Server streaming response type for the retrievePipeMessage method.
        type retrievePipeMessageStream: futures_core::Stream<
                Item = Result<super::RetrieveMessageResponse, tonic::Status>,
            >
            + Send
            + 'static;
        async fn retrieve_pipe_message(
            &self,
            request: tonic::Request<tonic::Streaming<super::RetrieveMessageRequest>>,
        ) -> Result<tonic::Response<Self::retrievePipeMessageStream>, tonic::Status>;
        async fn publish_pipe_message(
            &self,
            request: tonic::Request<super::PublishPipeMessageRequest>,
        ) -> Result<tonic::Response<super::PublishPipeMessageResponse>, tonic::Status>;
        async fn list_pipes_and_apps(
            &self,
            request: tonic::Request<super::super::entity::Empty>,
        ) -> Result<tonic::Response<super::ListPipesAndAppsResponse>, tonic::Status>;
    }
    #[derive(Debug)]
    pub struct LeganPipingServer<T: LeganPiping> {
        inner: _Inner<T>,
        accept_compression_encodings: (),
        send_compression_encodings: (),
    }
    struct _Inner<T>(Arc<T>);
    impl<T: LeganPiping> LeganPipingServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for LeganPipingServer<T>
    where
        T: LeganPiping,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/Legan.LeganPiping/createPipe" => {
                    #[allow(non_camel_case_types)]
                    struct createPipeSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::UnaryService<super::CreatePipeRequest>
                    for createPipeSvc<T> {
                        type Response = super::CreatePipeResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::CreatePipeRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).create_pipe(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = createPipeSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/Legan.LeganPiping/updatePipe" => {
                    #[allow(non_camel_case_types)]
                    struct updatePipeSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::UnaryService<super::UpdatePipeRequest>
                    for updatePipeSvc<T> {
                        type Response = super::UpdatePipeResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::UpdatePipeRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move { (*inner).update_pipe(request).await };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = updatePipeSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/Legan.LeganPiping/connectToPipe" => {
                    #[allow(non_camel_case_types)]
                    struct connectToPipeSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::UnaryService<super::PipeConnectionRequest>
                    for connectToPipeSvc<T> {
                        type Response = super::PipeConnectionResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::PipeConnectionRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move {
                                (*inner).connect_to_pipe(request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = connectToPipeSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/Legan.LeganPiping/retrievePipeMessage" => {
                    #[allow(non_camel_case_types)]
                    struct retrievePipeMessageSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::StreamingService<super::RetrieveMessageRequest>
                    for retrievePipeMessageSvc<T> {
                        type Response = super::RetrieveMessageResponse;
                        type ResponseStream = T::retrievePipeMessageStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                tonic::Streaming<super::RetrieveMessageRequest>,
                            >,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move {
                                (*inner).retrieve_pipe_message(request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = retrievePipeMessageSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/Legan.LeganPiping/publishPipeMessage" => {
                    #[allow(non_camel_case_types)]
                    struct publishPipeMessageSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::UnaryService<super::PublishPipeMessageRequest>
                    for publishPipeMessageSvc<T> {
                        type Response = super::PublishPipeMessageResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::PublishPipeMessageRequest>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move {
                                (*inner).publish_pipe_message(request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = publishPipeMessageSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/Legan.LeganPiping/listPipesAndApps" => {
                    #[allow(non_camel_case_types)]
                    struct listPipesAndAppsSvc<T: LeganPiping>(pub Arc<T>);
                    impl<
                        T: LeganPiping,
                    > tonic::server::UnaryService<super::super::entity::Empty>
                    for listPipesAndAppsSvc<T> {
                        type Response = super::ListPipesAndAppsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::super::entity::Empty>,
                        ) -> Self::Future {
                            let inner = self.0.clone();
                            let fut = async move {
                                (*inner).list_pipes_and_apps(request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = listPipesAndAppsSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: LeganPiping> Clone for LeganPipingServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
            }
        }
    }
    impl<T: LeganPiping> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(self.0.clone())
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: LeganPiping> tonic::transport::NamedService for LeganPipingServer<T> {
        const NAME: &'static str = "Legan.LeganPiping";
    }
}
